package com.stottlerhenke.simbionic.api;
import java.util.ArrayList;

/**
 * <p>Description: Any simulation that wishes to interface with Simbionic MUST implement
 * a class derived from this abstract base class.</p>
 */

public abstract class SB_Interface {
  public static final String getVersion(){ return "2.2";}

  public SB_Interface() {
  }
  /**
   * Invokes the specified action for the specified entity in the
   * simulation.  Note that values may be returned in the parameter list.
   *
   * @param actionId unique ID of the action to be invoked (defined in config tool)
   * @param entityId unique ID of the simulation entity invoking the action
   * @param params vector containing the action's parameters
   */
  public abstract void doAction(int actionId, long entityId, ArrayList params) 
  	throws SB_Exception;

  /**
   * Invokes the specified predicate for the specified entity in the
   * simulation.  Note that values may be returned in the parameter list.
   *
   * @param predId unique ID of the predicate to be invoked (defined in config tool)
   * @param entityId unique ID of the simulation entity invoking the predicate
   * @param params vector containing the predicate's parameters
   * @return the predicate's return value
   */
  public abstract SB_Param doPredicate(int predId, long entityId, ArrayList params)
  	throws SB_Exception;

  /**
   * This method will allow a loaded module to identify itself to the engine so that
   * it can be properly registered.
   *
   * @return the name of the module implemented by the class
   */
  public String getModuleName()
  {
    return new String("");
  }

  /**
   * Returns a list of the actions implemented by this module implementation.
   * More specifically, it returns a list of SB_FunctionDeclaration objects that
   * specify the name, identifier, and parameters of each action.
   *
   * @return a list of the SB_FunctionDeclaration implemented by this module implementation
   */
  public ArrayList getModuleActions()
  {
    return new ArrayList();
  }

  /**
   * Returns a list of the predicates implemented by this module implementation.
   * More specifically, it returns a list of SB_FunctionDeclaration objects that
   * specify the name, identifier, return type, and parameters of each predicate.
   *
   * @return a list of the SB_FunctionDeclaration implemented by this module implementation
   */
  public ArrayList getModulePredicates()
  {
    return new ArrayList();
  }
  
  /**
   * @param actionId ID of the action to retrieve the name of
   * @return the name of the action with the specified ID
   */
  public String getActionName(int actionId) { return new String(""); }

  /**
   * @param predId ID of the predicate to retrieve the name of
   * @return the name of the predicate with the specified ID
   */
  public String getPredicateName(int predId) { return new String(""); }
 
}